﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace _00365.Biz
{
    public class Company
    {

        public static Data.Company GetMain()
        {
            return DBInstance.Models.Companies.Where(i => i.Parent_Id.Equals(null)).FirstOrDefault();
        }
        
        public static List<Data.Company> GetSubsidiaries()
        {
            return (from i in DBInstance.Models.Companies
                    where i.Parent_Id != null
                    select i).ToList();
        }
    }
}